package com.roadjava.demo11.handler;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;

@RestController
@Validated // 表示整个类启用校验，如果碰到入参含有 bean validation注解的话，就会自动校验
public class UserInfoHandler11 {

    @GetMapping("/getByName2")
    public String getByName2(@NotNull String name) {
        return name + "ok";
    }

}